<input type="hidden" name="action" value="editor" />
<input type="hidden" name="item" value="<?php echo $item['id']; ?>" />
<fieldset>
	<dl>
		<dt>&nbsp;</dt>
		<dd><input type="submit" value="Save" style="padding-left:20px; padding-right:10px;  background-image: url('../images/system/save.gif'); border:1px solid #DDDDDD; height:20px;" class="buttons">
		</dd>
	</dl>
	<dl>
		<dt>Module ID:</dt>
		<dd>
			<input name="mod_id" maxlength="3" type="text" value="<?php echo $item['mod_id']; ?>" style="width:30%">
			&nbsp;<?php echo $error['mod_id']; ?>
		</dd>
	</dl>
	<dl>
		<dt>Name Left:</dt>
		<dd>
			<input name="name_l" type="text" value="<?php echo $item['name_l']; ?>" style="width:30%">
			&nbsp;<?php echo $error['name_l']; ?>
		</dd>
	</dl>
	<dl>
		<dt>Name Right:</dt>
		<dd>
			<input name="name_r" type="text" value="<?php echo $item['name_r']; ?>" style="width:30%">
			&nbsp;<?php echo $error['name_r']; ?>
		</dd>
	</dl>
	<dl>
		<dt>Display Type:</dt>
		<dd>
			<select name="type" style="width:30%;" onChange="submit()">
				<option value="0" <?php if ($item['type'] == 0){echo 'selected="selected"'; }?> >Default</option>
				<option value="1" <?php if ($item['type'] == 1){echo 'selected="selected"'; }?> >List</option>
				<option value="2" <?php if ($item['type'] == 2){echo 'selected="selected"'; }?> >Block</option>
				<option value="3" <?php if ($item['type'] == 3){echo 'selected="selected"'; }?> >Form</option>
				<option value="4" <?php if ($item['type'] == 4){echo 'selected="selected"'; }?> >Player</option>
				<option value="5" <?php if ($item['type'] == 5){echo 'selected="selected"'; }?> >Banner</option>
			</select>
			&nbsp;<?php echo $error['type']; ?>
		</dd>
	</dl>
	<dl>
		<dt>Module Sets:</dt>
		<dd>
			<select name="set_id" style="width:30%;">
				<?php 
				if($modcomsets)
				{
					foreach($modcomsets as $set)
					{
						if($set['id'] == $item['set_id'])
						{ echo '<option value="'.$set['id'].'" selected>'.$set['title'].'</option>'; }
						else
						{ echo '<option value="'.$set['id'].'">'.$set['title'].'</option>'; }
					}
				}
				?>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Path:</dt>
		<dd>
			<input name="path" type="text" value="<?php echo $item['path']; ?>" style="width:30%">
			&nbsp;<?php echo $error['path']; ?>
		</dd>
	</dl>
	<dl>
		<dt>HFB Composition Template Set:</dt>
		<dd>
			<select name="hfb_set" style="width:30%" onChange="submit();"  <?php if(!($item['site_id'] > 0)){ echo 'disabled="true"'; } ?>>
				<option value="0" selected>Default</option>
				<?php 
					if($item['site_id'] > 0)
					{
						$hfbsets = getHFBSetList();
						if($hfbsets)
						{
							foreach($hfbsets as $hfbset)
							{
								if ($hfbset['id'] == $item['hfb_set'])
								{
									echo '<option value="'.$hfbset['id'].'" selected="selected">'.$hfbset['name'].'</option>';
								}
								else
								{
									echo '<option value="'.$hfbset['id'].'">'.$hfbset['name'].'</option>';
								}
							}
						}
					}
				?>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Icon:</dt>
		<dd>
			<select name="icon" style="width:30%" onChange="document.edit_form.submit()">
				<option value="0" selected>-None-</option>
				<?php 
					if($_REQUEST['icon_set'] > 0)
					{
						$item['icon_set_id'] = $_REQUEST['icon_set'];
					}
					$result = mysql_query("SELECT * FROM ".DB_PERFIX."icons WHERE set_id=".$item['icon_set_id'].";");
					while($row = mysql_fetch_array($result))
					{
						if ($row['id'] == $item['icon'])
						{
							echo '<option value="'.$row['id'].'" selected>'.$row['name'].'</option>';
						}
						else
						{
							echo '<option value="'.$row['id'].'">'.$row['name'].'</option>';
						}
					}
				?>
			</select>
		</dd>
	</dl>
	<?php if($item['type'] == 1): ?>
    <dl>
		<dt>Object Type:</dt>
		<dd>
			<select name="object" style="width:30%" onChange="document.edit_form.submit()">
				<option value="0" <?php if ($item['object'] == 0){echo 'selected="selected"'; }?> >Undefined / Hardcoded</option>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Max Elements:</dt>
		<dd>
			<select name="max" style="width:30%" onChange="document.edit_form.submit()">
				<option value="0" selected>No Limit</option>
				<?php 
					for ($i = 1; $i<501; $i++)
					{
						if($i == $item['max'])
						{
							echo '<option value="'.$i.'" selected>'.$i.'</option>';
						}
						else
						{
							echo '<option value="'.$i.'" >'.$i.'</option>';
						}
					}
				?>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Elements in row:</dt>
		<dd>
			<select name="cols" style="width:30%" onChange="document.edit_form.submit()">
				<option value="0" selected>No Limit</option>
				<?php 
					for ($i = 1; $i<51; $i++)
					{
						if($i == $item['cols'])
						{
							echo '<option value="'.$i.'" selected>'.$i.'</option>';
						}
						else
						{
							echo '<option value="'.$i.'" >'.$i.'</option>';
						}
					}
				?>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Max rows:</dt>
		<dd>
			<select name="rows" style="width:30%" onChange="document.edit_form.submit()">
				<option value="0" selected>No Limit</option>
				<?php 
					for ($i = 1; $i<51; $i++)
					{
						if($i == $item['rows'])
						{
							echo '<option value="'.$i.'" selected>'.$i.'</option>';
						}
						else
						{
							echo '<option value="'.$i.'" >'.$i.'</option>';
						}
					}
				?>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Indexing:</dt>
		<dd>
			<select name="indexing" style="width:30%" onChange="document.edit_form.submit()">
				<option value="0" <?php if ($item['indexing'] == 0){echo 'selected="selected"'; }?> >No</option>
				<option value="1" <?php if ($item['indexing'] == 1){echo 'selected="selected"'; }?> >Yes</option>
			</select>
		</dd>
	</dl>
	<?php else: ?>
	<input type="hidden" name="max" value="<?php echo $item['max']; ?>" />
	<input type="hidden" name="cols" value="<?php echo $item['cols']; ?>" />
	<input type="hidden" name="rows" value="<?php echo $item['rows']; ?>" />
	<input type="hidden" name="indexing" value="<?php echo $item['indexing']; ?>" />
	<?php endif; ?>
	
	<?php if($item['type'] == 4): ?>
	<dl>
		<dt>Media type:</dt>
		<dd>
			<select name="media_type" style="width:30%" onChange="document.edit_form.submit()">
				<option value="0" <?php if ($item['media_type'] == 0){echo 'selected="selected"'; }?> >Audio File</option>
				<option value="1" <?php if ($item['media_type'] == 1){echo 'selected="selected"'; }?> >Audio Playlist</option>
				<option value="2" <?php if ($item['media_type'] == 2){echo 'selected="selected"'; }?> >Photo File</option>
				<option value="3" <?php if ($item['media_type'] == 3){echo 'selected="selected"'; }?> >Photo Gallery</option>
				<option value="4" <?php if ($item['media_type'] == 4){echo 'selected="selected"'; }?> >Video Clip</option>
				<option value="5" <?php if ($item['media_type'] == 5){echo 'selected="selected"'; }?> >Video Playlist</option>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Player type:</dt>
		<dd>
			<select name="cols" style="width:30%" onChange="document.edit_form.submit()">
				<?php if ($item['media_type'] < 2): ?>
				<option value="0" selected>FLV Player</option>
				<?php endif; ?>
				<?php if (($item['media_type'] > 1) && ($item['media_type'] < 4)): ?>
				<option value="0" selected>DezinerFolio Gallery</option>
				<option value="1" selected>Photo Viewer</option>
				<?php endif; ?>
				<?php if ($item['media_type'] > 3): ?>
				<option value="0" selected>FLV Player</option>
				<?php endif; ?>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Player width:</dt>
		<dd>
			<select name="rows" style="width:30%" onChange="document.edit_form.submit()">
				<option value="0" selected>No Limit</option>
				<?php 
					for ($i = 1; $i<51; $i++)
					{
						if($i == $item['rows'])
						{
							echo '<option value="'.$i.'" selected>'.$i.'</option>';
						}
						else
						{
							echo '<option value="'.$i.'" >'.$i.'</option>';
						}
					}
				?>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Player height:</dt>
		<dd>
			<select name="indexing" style="width:30%" onChange="document.edit_form.submit()">
				<option value="0" <?php if ($item['indexing'] == 0){echo 'selected="selected"'; }?> >No</option>
				<option value="1" <?php if ($item['indexing'] == 1){echo 'selected="selected"'; }?> >Yes</option>
			</select>
		</dd>
	</dl>
	<?php else: ?>
	<input type="hidden" name="max" value="<?php echo $item['max']; ?>" />
	<input type="hidden" name="cols" value="<?php echo $item['cols']; ?>" />
	<input type="hidden" name="rows" value="<?php echo $item['rows']; ?>" />
	<input type="hidden" name="indexing" value="<?php echo $item['indexing']; ?>" />
	<?php endif; ?>
</fieldset>